import 'package:flutter_screenutil/flutter_screenutil.dart';

/*
解决不同终端的适配问题
 */

class ScreenAdapter {
  //先默认为iPhone6
  static init(context) {
    ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context);
  }

  //设置高度值
  static height(double value) {
    return ScreenUtil.getInstance().setHeight(value);
  }

  //设置宽度值
  static width(double value) {
    return ScreenUtil.getInstance().setWidth(value);
  }

  //获取物理屏幕的高度
  static getScreenHeight() {
    return ScreenUtil.screenHeightDp;
  }

  //获取物理屏幕的宽度
  static getScreenWidth() {
    return ScreenUtil.screenWidthDp;
  }

  //动态设置字体大小 sp (28的话 等于系统的14 大概)
  static size(double value){
    return ScreenUtil.getInstance().setSp(value);
  }

}
